//import verify rules package 
const joi=require('joi')
//define verify rules

const med_name=joi.string().required()
const med_id=joi.number().integer().min(1).required()
const sup_id=joi.number().integer().min(1).required()
const cust_id=joi.number().integer().min(1).required()
const doc_id=joi.number().integer().min(1).required()
const oper_id=joi.number().integer().min(1).required()
const sort_name=joi.string().required()
const num=joi.number().min(0).integer().required()
const price=joi.number().min(0.01).required()
const product_date=joi.date().required()
const expire_date=joi.date().required()
const product_place=joi.string().required()
const id=joi.number().integer().min(1).required()
const comments=joi.string().required()
const state=joi.number().required()
const selecttype=joi.string().required()
const datetype=joi.string().required()
const parttype=joi.string().required()
const inputtext=joi.required()
const start_part=joi.required()
const end_part=joi.required()
const start_date=joi.required()
const end_date=joi.required()
const name=joi.required()
exports.med_find_schema={
    body:{
        selecttype,
        datetype,
        parttype,
        inputtext,
        start_part,
        end_part,
        start_date,
        end_date,
    },
}

exports.pursup_find_schema={
    body:{
        selecttype,
        inputtext,
        start_date,
        end_date,
    },
}

exports.med_schema={
    body:{
        med_name,
        num,
        price,
        product_date,
        expire_date,
        product_place,
        sort_name,
    },
}

exports.med_update_schema={
    body:{
        id,
        med_name,
        num,
        price,
        product_date,
        expire_date,
        product_place,
        sort_name,
    },
}




exports.sort_update_schema={
    body:{
        id,
        sort_name,
    },
}

exports.sort_schema={
    body:{
        sort_name,
    },
}

exports.sort_find_schema={
    body:{
        name,
    },
}

exports.delete_schema={
    body:{
        id,
    },
}

exports.sup_schema={
    body:{
        sup_id,
        med_id,
        num,
        price,
        oper_id,
    },
}

exports.sup_update_schema={
    body:{
        id,
        sup_id,
        med_id,
        num,
        price,
        oper_id,
    },
}

exports.pur_schema={
    body:{
        cust_id,
        med_id,
        doc_id,
        num,
        state,
        price,
        comments,
    },
}

exports.pur_update_schema={
    body:{
        id,
        cust_id,
        med_id,
        doc_id,
        num,
        state,
        price,
        comments,
    },
}